package com.oocl.handlebatchdata.comparator;

import java.util.Arrays;
import java.util.Comparator;

import com.oocl.handlebatchdata.customer.Customer;

public class IdComparator implements Comparator<Customer>{

	public int compare(Customer o1, Customer o2) {
		int result;
		result=Integer.parseInt(o1.getId())-Integer.parseInt(o2.getId());
		if(result==0){
			result=o1.getName().compareTo(o2.getName());
		}
		if(result==0){
			result=o1.getEmail().compareTo(o2.getEmail());
		}
		return result;
	}

}
